package br.com.fidalgotecnologia.layar.json;

import org.json.JSONException;
import org.json.JSONObject;


import br.com.fidalgotecnologia.layar.entity.Transform;

public class TransformJson {
public static TransformJson instance;
	
	public static TransformJson getInstance() {
		if(instance==null){
			instance= new TransformJson();
		}
		return instance;
	}
	
	public JSONObject toObject(Transform transform){
		JSONObject transformJson = new JSONObject();
		
		try {
			transformJson.put("rel",transform.isRel());
			transformJson.put("angle",transform.getAngle());
			transformJson.put("scale",transform.getScale());
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return transformJson;
	}
}
